声明 模块 "perf_hooks" {

    //@@{ 异步资源_:AsyncResource }
    导入 { 异步资源_ } 来自 "async_hooks";

    //@@{ 性能条目_:PerformanceEntry }
    接口 性能条目_ {
        /**
         * The total number of milliseconds elapsed for this entry.
         * This value will not be meaningful for all Performance Entry types.
         */

        //@@{ 持续时间:duration }
        只读 持续时间: 数字;

        /**
         * The name of the performance entry.
         */

        //@@{ 名称:name }
        只读 名称: 文字;

        /**
         * The high resolution millisecond timestamp marking the starting time of the Performance Entry.
         */

        //@@{ 开始时间:startTime }
        只读 开始时间: 数字;

        /**
         * The type of the performance entry.
         * Currently it may be one of: 'node', 'mark', 'measure', 'gc', or 'function'.
         */

        //@@{ 条目类型:entryType }
        只读 条目类型: 文字;

        /**
         * When performanceEntry.entryType is equal to 'gc', the performance.kind property identifies
         * the type of garbage collection operation that occurred.
         * The value may be one of perf_hooks.constants.
         */

        //@@{ 种类:kind }
        只读 种类?: 数字;
    }

    //@@{ 性能节点计时_:PerformanceNodeTiming, 性能条目_:PerformanceEntry }
    接口 性能节点计时_ 扩展 性能条目_ {
        /**
         * The high resolution millisecond timestamp at which the Node.js process completed bootstrap.
         */

        //@@{ 引导完成:bootstrapComplete }
        只读 引导完成: 数字;

        /**
         * The high resolution millisecond timestamp at which cluster processing ended.
         */

        //@@{ 群集设置结束:clusterSetupEnd }
        只读 群集设置结束: 数字;

        /**
         * The high resolution millisecond timestamp at which cluster processing started.
         */

        //@@{ 群集安装启动:clusterSetupStart }
        只读 群集安装启动: 数字;

        /**
         * The high resolution millisecond timestamp at which the Node.js event loop exited.
         */

        //@@{ 循环出口:loopExit }
        只读 循环出口: 数字;

        /**
         * The high resolution millisecond timestamp at which the Node.js event loop started.
         */

        //@@{ 循环开始:loopStart }
        只读 循环开始: 数字;

        /**
         * The high resolution millisecond timestamp at which main module load ended.
         */

        //@@{ 模块加载结束:moduleLoadEnd }
        只读 模块加载结束: 数字;

        /**
         * The high resolution millisecond timestamp at which main module load started.
         */

        //@@{ 模块加载启动:moduleLoadStart }
        只读 模块加载启动: 数字;

        /**
         * The high resolution millisecond timestamp at which the Node.js process was initialized.
         */

        //@@{ 节点启动:nodeStart }
        只读 节点启动: 数字;

        /**
         * The high resolution millisecond timestamp at which preload module load ended.
         */

        //@@{ 预加载模块加载结束:preloadModuleLoadEnd }
        只读 预加载模块加载结束: 数字;

        /**
         * The high resolution millisecond timestamp at which preload module load started.
         */

        //@@{ 预加载模块加载开始:preloadModuleLoadStart }
        只读 预加载模块加载开始: 数字;

        /**
         * The high resolution millisecond timestamp at which third_party_main processing ended.
         */

        //@@{ 第三方主结束:thirdPartyMainEnd }
        只读 第三方主结束: 数字;

        /**
         * The high resolution millisecond timestamp at which third_party_main processing started.
         */

        //@@{ 第三方主启动:thirdPartyMainStart }
        只读 第三方主启动: 数字;

        /**
         * The high resolution millisecond timestamp at which the V8 platform was initialized.
         */

        //@@{ V8开始:v8Start }
        只读 V8开始: 数字;
    }

    //@@{ 性能_:Performance }
    接口 性能_ {
        /**
         * If name is not provided, removes all PerformanceFunction objects from the Performance Timeline.
         * If name is provided, removes entries with name.
         * @param name
         */

        //@@{ 清除函数:clearFunctions }
        清除函数(名称?: 文字): 无值;

        /**
         * If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
         * If name is provided, removes only the named mark.
         * @param name
         */

        //@@{ 清除标志:clearMarks }
        清除标志(名称?: 文字): 无值;

        /**
         * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline.
         * If name is provided, removes only objects whose performanceEntry.name matches name.
         */

        //@@{ 清除措施:clearMeasures }
        清除措施(名称?: 文字): 无值;

        /**
         * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime.
         * @return list of all PerformanceEntry objects
         */

        //@@{ 获取条目:getEntries, 性能条目_:PerformanceEntry }
        获取条目(): 性能条目_[];

        /**
         * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
         * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type.
         * @param name
         * @param type
         * @return list of all PerformanceEntry objects
         */

        //@@{ 获取条目按名称:getEntriesByName, 性能条目_:PerformanceEntry }
        获取条目按名称(名称: 文字, 类型?: 文字): 性能条目_[];

        /**
         * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
         * whose performanceEntry.entryType is equal to type.
         * @param type
         * @return list of all PerformanceEntry objects
         */

        //@@{ 获取条目按类型:getEntriesByType, 性能条目_:PerformanceEntry }
        获取条目按类型(类型: 文字): 性能条目_[];

        /**
         * Creates a new PerformanceMark entry in the Performance Timeline.
         * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark',
         * and whose performanceEntry.duration is always 0.
         * Performance marks are used to mark specific significant moments in the Performance Timeline.
         * @param name
         */

        //@@{ 标记:mark }
        标记(名称?: 文字): 无值;

        /**
         * Creates a new PerformanceMeasure entry in the Performance Timeline.
         * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
         * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark.
         *
         * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify
         * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist,
         * then startMark is set to timeOrigin by default.
         *
         * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp
         * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown.
         * @param name
         * @param startMark
         * @param endMark
         */

        //@@{ 测量:measure }
        测量(名称: 文字, 开始标志: 文字, 结尾标记: 文字): 无值;

        /**
         * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
         */

        //@@{ 节点定时:nodeTiming, 性能节点计时_:PerformanceNodeTiming }
        只读 节点定时: 性能节点计时_;

        /**
         * @return the current high resolution millisecond timestamp
         */

        //@@{ 现在:now }
        现在(): 数字;

        /**
         * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured.
         */

        //@@{ 时间起点:timeOrigin }
        只读 时间起点: 数字;

        /**
         * Wraps a function within a new function that measures the running time of the wrapped function.
         * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed.
         * @param fn
         */

        //@@{ 使时间化:timerify }
        使时间化<T 扩展 (...可选参数: 任意[]) => 任意>(函: T): T;
    }

    //@@{ 性能服务器事件列表_:PerformanceObserverEntryList }
    接口 性能服务器事件列表_ {
        /**
         * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime.
         */

        //@@{ 获取条目:getEntries, 性能条目_:PerformanceEntry }
        获取条目(): 性能条目_[];

        /**
         * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
         * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type.
         */

        //@@{ 获取条目按名称:getEntriesByName, 性能条目_:PerformanceEntry }
        获取条目按名称(名称: 文字, 类型?: 文字): 性能条目_[];

        /**
         * @return Returns a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
         * whose performanceEntry.entryType is equal to type.
         */

        //@@{ 获取条目按类型:getEntriesByType, 性能条目_:PerformanceEntry }
        获取条目按类型(类型: 文字): 性能条目_[];
    }

    //@@{ 性能服务器回调_:PerformanceObserverCallback, 性能服务器事件列表_:PerformanceObserverEntryList }
    //@@{ 性能数据库服务器_:PerformanceObserver }
    类型 性能服务器回调_ = (列表: 性能服务器事件列表_, 观察者: 性能数据库服务器_) => 无值;

    //@@{ 性能数据库服务器_:PerformanceObserver, 异步资源_:AsyncResource }
    类别 性能数据库服务器_ 扩展 异步资源_ {

        //@@{ 性能服务器回调_:PerformanceObserverCallback }
        构造(回调: 性能服务器回调_);

        /**
         * Disconnects the PerformanceObserver instance from all notifications.
         */

        //@@{ 断开连接:disconnect }
        断开连接(): 无值;

        /**
         * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes.
         * When options.buffered is false, the callback will be invoked once for every PerformanceEntry instance.
         * Property buffered defaults to false.
         * @param options
         */

        //@@{ 观察:observe, 条目类型组:entryTypes, 缓冲:buffered }
        观察(选项组: { 条目类型组: 文字[], 缓冲?: 真假 }): 无值;
    }

    //@@{ 常量组:constants }
    名域 常量组 {

        //@@{ __NODE_性能_GC_主要__:NODE_PERFORMANCE_GC_MAJOR }
        常量 __NODE_性能_GC_主要__: 数字;

        //@@{ __NODE_性能_GC_次要__:NODE_PERFORMANCE_GC_MINOR }
        常量 __NODE_性能_GC_次要__: 数字;

        //@@{ __NODE_性能_GC_增量__:NODE_PERFORMANCE_GC_INCREMENTAL }
        常量 __NODE_性能_GC_增量__: 数字;

        //@@{ __NODE_性能_GC_弱CB__:NODE_PERFORMANCE_GC_WEAKCB }
        常量 __NODE_性能_GC_弱CB__: 数字;
    }

    //@@{ 性能:performance, 性能_:Performance }
    常量 性能: 性能_;

    //@@{ 事件循环监视器选项_:EventLoopMonitorOptions }
    接口 事件循环监视器选项_ {
        /**
         * The sampling rate in milliseconds.
         * Must be greater than zero.
         * @default 10
         */

        //@@{ 分辨率:resolution }
        分辨率?: 数字;
    }

    //@@{ 事件循环延迟监视器_:EventLoopDelayMonitor }
    接口 事件循环延迟监视器_ {
        /**
         * Enables the event loop delay sample timer. Returns `true` if the timer was started, `false` if it was already started.
         */

        //@@{ 启用:enable }
        启用(): 真假;
        /**
         * Disables the event loop delay sample timer. Returns `true` if the timer was stopped, `false` if it was already stopped.
         */

        //@@{ 禁用:disable }
        禁用(): 真假;

        /**
         * Resets the collected histogram data.
         */

        //@@{ 重置:reset }
        重置(): 无值;

        /**
         * Returns the value at the given percentile.
         * @param percentile A percentile value between 1 and 100.
         */

        //@@{ 百分位数:percentile }
        百分位数(百分位数: 数字): 数字;

        /**
         * A `Map` object detailing the accumulated percentile distribution.
         */

        //@@{ 百分位数组:percentiles, 映射_:Map }
        只读 百分位数组: 映射_<数字, 数字>;

        /**
         * The number of times the event loop delay exceeded the maximum 1 hour eventloop delay threshold.
         */

        //@@{ 超出:exceeds }
        只读 超出: 数字;

        /**
         * The minimum recorded event loop delay.
         */

        //@@{ 最小:min }
        只读 最小: 数字;

        /**
         * The maximum recorded event loop delay.
         */

        //@@{ 最大:max }
        只读 最大: 数字;

        /**
         * The mean of the recorded event loop delays.
         */

        //@@{ 意思是:mean }
        只读 意思是: 数字;

        /**
         * The standard deviation of the recorded event loop delays.
         */

        //@@{ 标准偏差:stddev }
        只读 标准偏差: 数字;
    }

    //@@{ 监视事件循环延迟:monitorEventLoopDelay, 事件循环监视器选项_:EventLoopMonitorOptions }
    //@@{ 事件循环延迟监视器_:EventLoopDelayMonitor }
    函数 监视事件循环延迟(选项组?: 事件循环监视器选项_): 事件循环延迟监视器_;
}
